package com.sky.mapper;

import com.sky.vo.Top10ItemVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface ReportMapper {
    List<String> getTurnoverByDateRange(LocalDate begin, LocalDate end);

    List<String> getTotalUserList(LocalDate begin, LocalDate end);

    List<String> getNewUserList(LocalDate begin, LocalDate end);

    List<String> getOrderCountList(LocalDate begin, LocalDate end);

    List<String> getValidOrderCountList(LocalDate begin, LocalDate end);
    @Select("select COUNT(id) from orders where order_time between #{begin} and DATE_ADD(#{end}, INTERVAL 1 DAY)")
    Integer getTotalOrderCount(LocalDate begin, LocalDate end);
    @Select("select COUNT(id) from orders where pay_status = 1 and order_time between #{begin} and DATE_ADD(#{end}, INTERVAL 1 DAY)")
    Integer getValidOrderCount(LocalDate begin, LocalDate end);

    List<Top10ItemVO> getTop10List(LocalDate begin, LocalDate end);
}
